Carbon


FSCreateFileUnicode

Header: Files.h Carbon status: Supported

Creates a new file in the specified directory.

OSErr FSCreateFileUnicode (
    const FSRef *parentRef, 
    UniCharCount nameLength, 
    const UniChar *name, 
    FSCatalogInfoBitmap whichInfo, 
    const FSCatalogInfo *catalogInfo, 
    FSRef *newRef, 
    FSSpec *newSpec
);
parentRef

A pointer to the directory where the file is to be created

nameLength

The length of the file's name, in Unicode characters.

name

A pointer to the Unicode name for the new file.

whichInfo

You may optionally specify which catalog info fields to set in this parameter.

catalogInfo

A pointer to the FSCatalogInfo structure which specifies the values for catalog info fields to set. This parameter is optional and may be NULL.

newRef

On return, a pointer to the FSRef for the new file. This parameter may be NULL.

newSpec

On return, a pointer to the FSSpec for the new file. This parameter may be NULL.

function result

A result code.

DISCUSSION

You may optionally set catalog information for the file using the whichInfo and catalogInfo parameters; this is equivalent to calling FSSetCatalogInfo after creating the file. If possible, you should set the textEncodingHint in the catalogInfo.

AVAILABILITY

Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)